package com.huage_05.lesson_03;

public class IntegerDemo {
    public static void main(String[] args) {
        //int转String
        int number = 100;
        //方式一
        String str1 = ""+ number;
        System.out.println(str1);
        //方式二
        String str2 = String.valueOf(number);
        System.out.println(str2);

        //String转int
        String str = "100";
        //方式一
        Integer i = Integer.valueOf(str);
        int x = i.intValue();
        System.out.println("x = " + x);
        //方式二
        int y = Integer.parseInt(str);
        System.out.println("y = " + y);

    }
}
